import request from '@/utils/request';
import { parseStrEmpty } from '@/utils/ruoyi';

//查询目录树数据
export function listResourceCatalog(params) {
  return request({
    url: '/resource/resourceCatalog/list',
    method: 'get',
    params: params
  })
}
//插入目录
export function insertDir(data){
  return request({
    url:'/resource/resourceCatalog/dir/insert',
    method:'post',
    data:data
  })
}
//更新目录
export function updateDir(data){
  return request({
    url:'/resource/resourceCatalog/dir/update',
    method:'put',
    data:data
  })
}
//插入服务节点
export function insertResource(data){
  return request({
    url:'/resource/resourceCatalog/resource/insert',
    method:'post',
    data:data
  })
}
//更新服务节点
export function updateResource(data){
  return request({
    url:'/resource/resourceCatalog/resource/update',
    method:'put',
    data:data
  })
}
//删除目录树节点
export function deleteResourceCatalogItem(id) {
  return request({
    url:'/resource/resourceCatalog/delete/'+id,
    method:'delete'
  })
}
//目录树数据更新排序
export function sortResourceCatalog(data) {
  return request({
    url:'/resource/resourceCatalog/sort',
    method:'put',
    data:data
  })
}
//更新服务查询配置
export function updateCatalogQuery(data){
  return request({
    url:'/resource/resourceCatalog/queryConfig/update',
    method:'put',
    data:data
  })
}
//查询服务的查询配置
export function queryCatalogQuery(serviceId) {
  return request({
    url:'/resource/resourceCatalog/queryConfig/query/'+serviceId,
    method:'get'
  })
}
//更新服务统计配置
export function updateCatalogStatistics(data) {
  return request({
    url:'/resource/resourceCatalog/statisticsConfig/update',
    method:'put',
    data:data
  })
}
//查询服务统计配置
export function queryCatalogStatistics(serviceId) {
  return request({
    url:'/resource/resourceCatalog/StatisticsConfig/query/'+serviceId,
    method:'get'
  })
}
//上传图例
export function uploadLegendFile(formData) {
  return request({
    url:'/resource/resourceCatalog/legendUpload',
    method:'post',
    data:formData
  })
}
//上传节点图标
export function uploadCatalogIconFile(formData) {
  return request({
    url:'/resource/resourceCatalog/catalogIconUpload',
    method:'post',
    data:formData
  })
}

